package com.hmall.common.config;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 自定义拦截器
 *
 * @Author 15198
 * @Date 2022/8/12 9:45
 * @Description: 自定义拦截器
 * @Created by
 */
@Component
@Slf4j
public class MyInterceptor implements RequestInterceptor {

    @Override
    public void apply(RequestTemplate requestTemplate) {

        log.warn("feign的拦截器中----requestTemplate.url是------》 {}",requestTemplate.url());
        requestTemplate.header("authorization", "2");
        requestTemplate.header("test", "test");
    }
}
